#include "seg.h"
//0 - 9 熄灭

idata unsigned char Seg_Dula[] = {0xc0, 0xf9, 0xa4, 0xb0, 0x99, 0x92, 0x82, 0xf8, 0x80, 0x90, 0xff};

void Seg_Disp(unsigned char wula, unsigned char dula, unsigned char point)
{
    //消隐
    P0 &= 0xff;
    P2 = (P2 & 0x1f) | 0xe0;
    P2 &= 0x1f;

    //位选
    P0 = 0x01 << wula;
    P2 = (P2 & 0x1f) | 0xc0;
    P2 &= 0x1f;

    //段选
    P0 = Seg_Dula[dula];
    if(point) P0 &= 0x7f;
    P2 = (P2 & 0x1f) | 0xe0;
    P2 &= 0x1f;

}
